<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head th:include="include :: header"></head>
<body class="hold-transition skin-blue sidebar-mini">
<section class="content-header">
    <h1>产品结构查询</h1>
</section>
<section class="content">
    <div class="row">
        <div class="col-xs-12">
            <div class="box">
                <div class="box-header">
                    <form id="queryForm" onsubmit="return false;">
                        <div class="row">
                            <div class="form-inline">
                                <div class="form-group">
                                    <label for="query-proCode">项目编号</label>
                                    <input id="query-proCode" type="text" name="proCode" class="form-control"
                                           placeholder="请输入项目编号">
                                </div>
                                <div class="form-group">
                                    <label for="query-proName">项目名称</label>
                                    <input id="query-proName" type="text" name="proName" class="form-control"
                                           placeholder="请输入项目名称">
                                </div>
                                <div class="form-group">
                                    <label for="query-section">科室</label>
                                    <input id="query-section" type="text" name="depts" class="form-control"
                                           placeholder="请输入科室">
                                </div>
<!--                                <div class="form-group">-->
<!--                                    <label for="query-status">审核状态</label>-->
<!--                                    <select id="query-status" class="form-control" name="status">-->
<!--                                        <option value="">请选择</option>-->
<!--                                        <option value="2">未审核</option>-->
<!--                                        <option value="3" selected="selected">已审核</option>-->
<!--                                    </select>-->
<!--                                </div>-->
                                <button type="button" class="btn btn-success" id="btn-search"
                                        onclick="js.table.search(table)">
                                    <span class="Bold">搜索</span>
                                </button>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="box-body">
                    <table id="bootstrap-table"></table>
                </div>
            </div>
        </div>
    </div>
</section>
<div th:include="include :: footer"></div>
<script th:inline="javascript">

    let table;

    $(function () {

        /** 产品结构查询 */
        table = js.table.init({
            url: ctx + "main/productMixPage/list",
            showExport: false,
            columns: [
                {
                    title: '序号', field: 'id', width: '50',
                    formatter: function (value, row, index) {
                        return index + 1;
                    }
                },
                {title: "项目编号", field: 'proCode'},
                {title: "项目名称", field: 'proName',width:'300'},
                {title: "项目数量", field: 'proNum'},
                {title: "需方", field: 'demander'},
                {
                    title: "分配科室", field: 'depts',
                    formatter: function (value, row) {
                        if (value != null) {
                            return value.split(',').join('<br>');
                        }
                    }
                },
                {
                    title: "已创建专业", field: 'special',
                    formatter: function (value, row) {
                        if (value != null) {
                            return value.split(',').join('<br>');
                        }
                    }
                },
                {
                    title: "审核状态", field: 'status',
                    formatter: function (value) {
                        if (value === 2) {
                            return '<span class="badge label-inverse">未审核</span>';
                        } else if (value === 3) {
                            return '<span class="badge label-success">已审核</span>';
                        }
                    }
                },
                {title: "审核时间", field: 'verifyTime'},
                {
                    title: "操作", field: 'operate',
                    formatter: function (value, row) {
                        let actions = [];
                            actions.push('<a class="btn btn-info btn-xs" href="' + ctx + 'designTask/proStruct/checkProStruct/' + row.proId + '"> 查看</a> ');
                        return actions.join('');
                    }
                }
            ]
        });
    });
</script>
</body>
</html>
